{% extends 'base.html' %}
{% block list-main %}
    <div class="container-fluid">
        <div class="row">
                {% include 'author_sidebar.html' %}
            <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
                <div class="panel panel-primary">
                    <!-- Default panel contents -->
                    <div class="panel-heading">添加作者 <i class="fa fa-thumb-tack pull-right"></i></div>
                    <div class="panel-body">
                        <form action="/add_author/" method="post" class="form-horizontal">
                            <div class="form-group">
                                <div class="col-sm-5">
                                    <label for="a1">添加作者名</label>
                                    <input type="text" id="a1" name="authorname" class="form-control">
                                </div>
                            </div>
                            <p style="color: red">{{ error }}</p>

                            <div class="form-group">
                                <div class="col-sm-5">
                                    <label for="ms1">代表作</label>
                                    <select multiple name="new_book" class="form-control" id="ms1">
                                        {% for book in book_list %}
                                            <option value="{{ book.id }}">{{ book.name }}</option>
                                        {% endfor %}
                                    </select>
                                </div>
                            </div>

                            <p>
                                <button type="submit" class="btn btn-success">提交</button>
                            </p>
                        </form>

                    </div>

                </div>
            </div>
        </div>
    </div>
{% endblock %}